<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算商品总价</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
       <p>
           商品单价：<input type="text" v-model.number="price">
       </p>
       <p>
           商品数量：<input type="text" v-model.number="num">
       </p>
       <p>
           总价：{{totalPrice}}
       </p>

    </div>

  
</body>
<script>
   
    let vm = new Vue({
        el:'#app',
        data:{
           price:0,
           num:0
        },
        methods: {
            
        },
        filters:{

        },
        computed: {
            totalPrice(){
                return this.price * this.num
            }
        },
    })


  

</script>
</html>